import matplotlib.pyplot as plt
import numpy as np

# 中文显示
plt.rcParams['font.sans-serif'] = ['Microsoft YaHei','DV Sans']
plt.rcParams['axes.unicode_minus'] = False

theta = np.linspace(0, 2*np.pi, 100)
x = 2 * np.cos(theta)  # 半径为2的圆的参数方程
y = 2 * np.sin(theta)

plt.figure(figsize=(8, 8))
plt.plot(x, y, label='$x^2 + y^2 = 4$')
plt.plot(0, 2, 'ro', label='点(0,2)')
plt.arrow(0, 0, 0, 2, head_width=0.1, head_length=0.1, fc='g', ec='g', 
          label='原点至点的连线')
plt.axis('equal')
plt.grid(True)
plt.xlabel('x')
plt.ylabel('y')
plt.title('曲线切线问题解')
plt.legend()
plt.show()